<link href="../addons/jy_area_dai/custom/templates/mobile/style.css?v=201705251730" rel="stylesheet">
<style>
	.fui-cell-label{
		align-self: flex-start;
		line-height: normal;
	}

</style>
<div ng-if="pagedata.op=='main'" class="fui-page fui-page page-commission-selectgoods">
    <div class="fui-content navbar">
	<div class="fui-fullHigh-group" >
        <div class="fui-fullHigh-item menu" id="tab">
            <nav class="on">经销的商品</nav>
        </div>
        <div class="fui-fullHigh-item container">
              <div class="searchbar" style='margin:0;padding:0'>
                    <div class="search-input">
                        <i class="icon icon-search" ng-click="tool.get_list('jy_area_dai/mygoods/getlist/keyword='+pagedata.params.keyword,true)"></i>
                        <input type="search" id='keywords' ng-model="pagedata.params.keyword" placeholder="输入关键字..." style="border: 1px solid #f7f7f7;">
                    </div>
              </div>
			   <div class="weui_btn_area c">
					 <a href="javascript:;" ng-click="access_json(pagedata.merchurl)" class='btn btn-sm btn-danger-o external' style="border-radius: 100px;width: 7rem;font-size: .75rem">添加经销商品</a>
				</div>
				<p ng-if="pagedata.list.length<1" class="text-center text-cancel empty" style="margin-top:2rem;color:#999">
				暂时没有任何商品
				</p>
				<div class="fui-list-group goods-list-group" style="margin-top:0;">
					<div ng-repeat="g in pagedata.list" class="fui-list goods-item">
							<div class="fui-list-media">
								<img ng-src="{{tomedia(g.image) || '../core/resource/images/nopic.jpg'}}" class='round'/>
							</div>
							<div class='fui-list-inner'>
								<div class='subtitle'>
									<span>{{g.title}}</span>
								</div>
								<div class='text'>
									<span class='text-danger'>￥{{g.price}}</span>
									<span class='delete'>原价：￥{{g.originalprice}}</span>
								</div>
								<div class='text'>
									<span class='text-danger'>库存{{g.total}}</span>
									<div class="btn btn-sm btn-default-o order-delete r-f" style="padding:0 0.2rem;margin-top:0.3rem" href="javascript:;" ng-click="access_json('jy_area_dai/mygoods/detail/id='+g.id)">编辑</div>
								</div>
							</div>						
					</div>
				</div>
				<div ng-if="pagedata.loading" class='infinite-loading'><span class='fui-preloader'></span><span class='text'> 正在加载...</span></div>
        </div> 
    </div>
</div>
</div>
<div ng-if="pagedata.op=='detail'" class="fui-page fui-page-current">
	<div class="fui-header">
        <div class="title">商品经销</div>
    </div>
	<div class='fui-content'>
		<div class='fui-cell-group'>
			<div class='fui-cell'>
				<div class='fui-cell-label'>商品名称</div>
				<div class='fui-cell-info'><input type="text" class='fui-input' id="shopname" ng-model="pagedata.item.title"  placeholder=''/></div>
			</div>
			<div class='fui-cell'>
				<div class='fui-cell-label'>商品图片</div>
				<div class="fui-list jump">
					<a class="fui-list-media" >
						<img class="round" ng-src="{{tomedia(pagedata.item.image) || '../core/resource/images/nopic.jpg'}}" />
					</a>
					
				</div>
			</div>
			<div class='fui-cell'>
				<div class='fui-cell-label'>零售价</div>
				<div class='fui-cell-info'>{{pagedata.item.price}} (平台统一设置)</div>
			</div>
			<div class='fui-cell'>
				<div class='fui-cell-label'>补偿金</div>
				<div class='fui-cell-info'><input type="text" class='fui-input' ng-model="pagedata.item.bufee"/></div>
			</div>
		</div>
		<div class="weui_cells_title" style="margin:0.5rem;padding-left:0.2rem">佣金设置</div>
		<div class="item-up-content item-ng">
					<div class="weui_cells weui_cells_form">
						<!--<div class="weui_cell">
							<div class="weui_cell_hd">适用等级</div>
							<div class="weui_cell_bd weui_cell_primary">
								<select class="weui_select" ng-model="item.level_id">
									<option value="" ng-selected="item.level_id=='' || !item.level_id">请选择</option>
									<option ng-repeat="(key,value) in pagedata.levels" selected="item.level_id==value.id;" value="{{value.id}}">{{value.title}}</option>
								</select>
							</div>
							<div class="weui_cell_ft" style="" ng-click="pagedata.item.commissions.splice($index,1)">
								<i class="icon icon-cuowu bold" style="color:#000">删除</i>
							</div>
						</div>-->
						<div class="weui_cell">
							<div class="weui_cell_hd">直推提成</div>
							<div class="weui_cell_bd weui_cell_primary">
								<input class="weui_input" type="number" ng-model="pagedata.item.commissions[0].tui_rate" placeholder="填写直推提成" style="text-align:right">
							</div>
						</div>
						<div class="subtitle">填写数字表示实际额度，填写百分数表示比例。例如填写1表示获得1元'.'，填写1%表示获得价格的1%</div>
						<div class="weui_cell">
							<div class="weui_cell_hd">销售提成</div>
							<div class="weui_cell_bd weui_cell_primary">
								<input class="weui_input" type="number" ng-model="pagedata.item.commissions[0].sale_rate" placeholder="填写销售提成" style="text-align:right">
							</div>
						</div>
						<div class="subtitle">填写数字表示实际额度，填写百分数表示比例。例如填写1表示获得1元'.'，填写1%表示获得价格的1%</div>
						<!--<div class="weui_cell">
							<div class="weui_cell_hd">平级奖励</div>
							<div class="weui_cell_bd weui_cell_primary">
								<input class="weui_input" type="number" ng-model="item.ping_rate" placeholder="填写平级奖励" style="text-align:right">
							</div>
						</div>
						<div class="subtitle">填写数字表示实际额度，填写百分数表示比例。例如填写1表示获得1元'.'，填写1%表示获得价格的1%</div>-->
					</div>
				<!--<div class="weui_cells weui_cells_form">
						<div class="weui_cell noborder">
							<div class="weui_cell_bd weui_cell_primary" ng-click="pagedata.item.api_data.commissions.push({'sale_rate':'','ping_rate':''});">
								+ 添加一个设置
							</div>
						</div>
				</div>-->
			</div>
		 <div class="weui_btn_area">
			<a class="weui_btn weui_btn_primary" href="javascript:" id="showTooltips" ng-click="post(pagedata.item,'jy_area_dai/mygoods/detail/')">提交</a>
		 </div>
	</div>
</div>
<div ng-include="sys_html('_footer')"></div>
<script>
if(scope.pagedata.op=='main'){
	scope.tool.get_list('jy_area_dai/mygoods/getlist/',true);
	scope.pagedata.scroll_bottom=function(){
		scope.tool.get_list('jy_area_dai/mygoods/getlist/');
	}
}

</script>